import java.util.Random;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int seed =sc.nextInt();
        int n = 0;
        int count = 0;
        Random random = new Random();
        random.setSeed(seed);
        int c[] = new int[6];
        for (int i = 0; i < 100; i++) {
            n = random.nextInt(6)+1;
            System.out.print(n+" ");
            c[n-1]++;
            count++;
            if(count%10==0){
                System.out.println();
            }
        }
        for (int i = 0; i < c.length; i++) {
            System.out.println((i+1)+"出现"+c[i]+"次");
        }
        sc.close();
    }
}